<%--
  Created by IntelliJ IDEA.
  User: meng
  Date: 2020/5/21
  Time: 18:51
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<% String path = request.getContextPath();%>


<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <%--<meta http-equiv="Cache-Control" content="max-age=300" />--%>
    <%--设置页面不缓存--%>
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-cache">
    <meta http-equiv="Expires" content="0">

    <link rel="stylesheet" href="<%=path%>/static/css/web/findJob/font-awesome.min.css">
    <link rel="stylesheet" href="<%=path%>/static/css/web/findJob/reset.css">
    <link rel="stylesheet" href="<%=path%>/static/css/web/findJob/style.css">
    <link href="<%=path%>/static/css/web/findJob/main1.css" rel="stylesheet" type="text/css" />
    <link href="<%=path%>/static/css/web/findJob/style1.css" rel="stylesheet" type="text/css"/>


    <style type="text/css">
        .shaixuan-btn clearfix{width: 5px;}
        .list-page{padding:0px 0;text-align:center;}
        .list-page a a{margin:0 5px;padding:2px 7px;border:1px solid #ccc;background:#f3f3f3;}
        .list-page a a:hover{background:#e4e4e4;border:1px solid #908f8f;}
        .list-page .current{margin:0 5px;padding:2px 7px;background:#f60;border:1px solid #fe8101;color:#fff;}
        .slide-body-nup-icon {
            background-image: url(<%=path%>/static/images/web/course_ab.png);
        }
    </style>


</head>
<body>
<%--导航栏--%>
<div class="navbg" style="margin-bottom: 10px;margin-top: 1px;">
    <div class="col960">
        <ul id="navul" class="cl">
            <li class="navhome"><a href="${pageContext.servletContext.contextPath}/web/index">首页</a></li>

        </ul>
    </div>
</div>



<%--选择栏--%>
<div style="width:946px; margin:0 auto;">
    <div class="clearfix">
        <p class="shaixuan-tj floatLeft clearfix">
            <span><a href="">请选择：</a></span>
            <i class="icon-angle-right"></i>
            <%--<span><strong>“工程一”</strong></span>--%>
            <i class="icon-angle-right"></i>
        </p>
        <%--javascript:void(0)--%>
        <%--<p id="sxbtn" class="shaixuan-btn clearfix"><span><em>收起筛选</em><i class="icon-angle-up"></i></span></p>--%>
        <a href=""><p class="shaixuan-btn clearfix"><span><em>重置</em><i class="icon-angle-up"></i></span></p></a>
    </div>
    <div id="page-search-store" class="mb10 border sxcon">
        <div class="search-by by-category relative">
            <dl class="relative clearfix">
                <dt class="floatLeft"><a href="#">行业：</a></dt>
                <dd class="floatLeft show-con">

                    <c:if test="${requestScope.industries!=null}">
                        <c:forEach items="${requestScope.industries}" var="industry" varStatus="x">
                            <a href="" class="" id="industry${industry.id}">${industry.industryName}</a>
                        </c:forEach>
                    </c:if>

                    <%--<a href="#" class="nzw12">进口个人护理</a>--%>
                </dd>
                <dd class="floatLeft show-more"><h3 class="pointer clearfix"><span><strong>更多</strong></span><i class="icon-angle-down"></i></h3></dd>
            </dl>
            <dl class="relative clearfix" style="border-bottom:0">
                <dt class="floatLeft"><a href="#">职位类型：</a></dt>
                <dd class="floatLeft show-con" >
                    <c:if test="${requestScope.positionTypes!=null}">
                        <c:forEach items="${requestScope.positionTypes}" var="positionType" varStatus="x">
                            <a href="#" class="" id="type${positionType.id}">${positionType.positionTypeName}</a>

                        </c:forEach>
                    </c:if>

                </dd>
                <dd class="floatLeft show-more"><h3 class="pointer clearfix"><span><strong>更多</strong></span><i class="icon-angle-down"></i></h3></dd>
            </dl>
            <dl class="relative clearfix" style="border-bottom:0">
                <dt class="floatLeft"><a href="#">职位：</a></dt>
                <dd class="floatLeft show-con">

                    <c:if test="${requestScope.positions!=null}">
                        <c:forEach items="${requestScope.positions}" var="position" varStatus="x">
                            <a href="#" class="" id="position${position.id}">${position.positionName}</a>
                        </c:forEach>
                    </c:if>

                </dd>
                <dd class="floatLeft show-more"><h3 class="pointer clearfix"><span><strong>更多</strong></span><i class="icon-angle-down"></i></h3></dd>
            </dl>
        </div>
    </div>
</div>


<%--moban--%>

<div class="floor-course">
    <div class="floor-content">
       <%-- <div class="floor-side">
            <h3>
                <a href="#">公司</a>
            </h3>
            <a href="#" class="floor-side-link">
                <img src="images/head-fl.jpg" alt="">
            </a>
        </div>--%>
        <div class="floor-side-right">
            <div class="hd floor-side-list">
                <ul>
                    <li class="on" id="hangYe">行业</li>
                    <li id="leiXing">职位类型</li>
                    <li id="zhiWei">职位</li>
                </ul>
                <%--<a href="#" class="slide-more">更多>></a>--%>
            </div>
            <div class="bd floor-side-body">
                <ul id="zhu">

                </ul>
                <ul id="zhu1">

                </ul>
                <ul id="zhu2">

                </ul>

            </div>
        </div>
    </div>
</div>





</body>
</html>

<script src="<%=path%>/static/js/jquery-3.4.1.min.js"></script>
<script src="<%=path%>/static/js/web/findJob/jquery.min.js"></script>
<script type="text/javascript" src="<%=path%>/static/js/web/findJob/jquery.SuperSlide.2.1.1.js"></script>
<script type="text/javascript">
    jQuery(".floor-side-right").slide({
        effect: "fade",
        autoPlay: false,
        trigger: "mouseover",
        delayTime: 700
    });
</script>

<script>
    var path="${pageContext.servletContext.contextPath}";
    $(function () {
        var industryId;
        var typeId;
        var positionId;
        //行业id
        $("[id^=industry]").click(function () {
            industryId=$(this).attr("id").substring(8);
            var val = $(this).text();
            //alert(val)
            $("#hangYe").html(val);
            initData(1,industryId)
            $("#zhu").show()
            $("#zhu2").hide()
            $("#zhu1").hide()
            $("#leiXing").removeClass('on');
            $("#zhiWei").removeClass('on');
            $("#hangYe").addClass('on');
        });
        //职业类型id
        $("[id^=type]").click(function () {
            typeId=$(this).attr("id").substring(4);
            var val = $(this).text();
            $("#leiXing").html(val);
            initData1(1,typeId)
            $("#zhu1").show()
            $("#zhu").hide()
            $("#zhu2").hide()
            $("#hangYe").removeClass('on');
            $("#zhiWei").removeClass('on');
            $("#leiXing").addClass('on');
        });
        //职业id
        $("[id^=position]").click(function () {
            positionId=$(this).attr("id").substring(8);
            var val = $(this).text();
            $("#zhiWei").html(val);
            initData2(1,positionId)
            $("#zhu2").show()
            $("#zhu").hide()
            $("#zhu1").hide()
            $("#hangYe").removeClass('on');
            $("#leiXing").removeClass('on');
            $("#zhiWei").addClass('on');

        });
        //给页码添加点击事件
        $("#zhu").on("click",".current",function () {
            var pageNum=$(this).html();
            initData(pageNum,industryId)
            return false;//取消对象的默认动作
        });
        $("#zhu1").on("click",".current",function () {
            var pageNum=$(this).html();
            initData1(pageNum,typeId)
            return false;//取消对象的默认动作
        });
        $("#zhu2").on("click",".current",function () {
            var pageNum=$(this).html();
            initData2(pageNum,positionId)
            return false;//取消对象的默认动作
        });
    })


    $(function(){

        $(".shaixuan-tj span.crumb-select-item").live('hover',function(event){
            if(event.type=='mouseenter'){
                $(this).addClass("crumb-select-itemon");
            }else{
                $(this).removeClass("crumb-select-itemon");
            }
        });
        $(".shaixuan-tj span.crumb-select-item").live('click', function(event){
            event.preventDefault();
            $(this).remove();
            var TTR = $(this).find("em").text();
            $(".show-con a").each(function(){
                var TT = $(this).text();
                THI = $(this);
                THIPP = $(this).parents("dl");
                if(TTR==TT){
                    THI.removeClass("nzw12");
                    THIPP.css("display","block");
                }
            })
        });
        $(".show-con a").click(function(event){
            event.preventDefault();
            THIP = $(this).parents("dl");
            if($(this).hasClass("nzw12")){
            }else{
                $(this).addClass("nzw12");
                var zhiclass = $(this).parents("dd").siblings("dt").find("a").text();
                zhicon = $(this).text();
                tianjaneir="<span class='crumb-select-item'><a href='javascript:void(0)' title='删除' class='delx'><b>"+zhiclass+"</b><em>"+zhicon+"</em></a></span>"
                $(".shaixuan-tj").children().last().after(tianjaneir);
                THIP.css("display","none");
            }
        });

        $(".show-more").click(function(event){
            event.preventDefault();
            var ticon = $(this).find("i");
            tspan = $(this).find("span");
            if($(this).hasClass("zk")){
                $(this).siblings(".show-con").css("height","30px");
                ticon.removeClass("icon-angle-up");
                ticon.addClass("icon-angle-down");
                tspan.html("<strong>更多</strong>");
                $(this).removeClass("zk")
            }else{
                $(this).siblings(".show-con").css("height","auto");
                ticon.removeClass("icon-angle-down");
                ticon.addClass("icon-angle-up");
                tspan.html("<strong>收起</strong>");
                $(this).addClass("zk")
            }
        });
        $("#sxbtn").click(function(event){
            event.preventDefault();
            var xicon = $(this).find("span i");
            xspan = $(this).find("span em");
            if($(this).hasClass("zkon")){
                xspan.text("收起筛选");
                xicon.removeClass("icon-angle-down");
                xicon.addClass("icon-angle-up");
                $(".sxcon").slideDown();
                $(this).removeClass("zkon")
            }else{
                xspan.text("查看筛选");
                xicon.removeClass("icon-angle-up");
                xicon.addClass("icon-angle-down");
                $(".sxcon").slideUp();
                $(this).addClass("zkon")
            }
        })


    })

    $(function () {

        //Ajax请求第一页不带条件的数据
        var title="${requestScope.positionOrCompanyName}";
        var selectedPosition="${requestScope.selectedPosition}";
        //alert(title)
        if (title!=""&&title!=null||selectedPosition!=""&&selectedPosition!=null){
            var data={title:title,selectedPosition:selectedPosition}

            $.get(path+"/web/job/listData3",data,function (data) {
                $("#zhu2").html(data);

                $("#zhu2").show()
                $("#zhu").hide()
                $("#zhu1").hide()
                $("#hangYe").removeClass('on');
                $("#leiXing").removeClass('on');
                $("#zhiWei").addClass('on');
            });

        }
        else {
            initData(1);
        }

    });

    //传入数据方法
    function initData(pageNum,industryId) {
        if (industryId==""){industryId=null;}
        //console.log("pageNum:"+pageNum)
        //console.log("industryId:"+industryId)
        var data={pageNum:pageNum,industryId:industryId}

        $.get(path+"/web/job/listData",data,function (data) {
            $("#zhu").html(data);
        });
    };
    function initData1(pageNum,typeId) {
        if (typeId==""){typeId=null;}
       // console.log("pageNum:"+pageNum)
        //console.log("typeId:"+typeId)
        var data={pageNum:pageNum,typeId:typeId}

        $.get(path+"/web/job/listData1",data,function (data) {
            //console.log(data)
            $("#zhu1").html(data);
        });
    };
    function initData2(pageNum,positionId) {
        if (positionId==""){positionId=null;}
        //console.log("pageNum:"+pageNum)
       // console.log("positionId:"+positionId)
        var data={pageNum:pageNum,positionId:positionId}

        $.get(path+"/web/job/listData2",data,function (data) {
            //console.log(data)
            $("#zhu2").html(data);

        });
    };
</script>

